#include"List.h"

ListNode* plist = NULL;

test1()
{
	plist = ListNodeInit();

	ListNodePushBack(plist, 1);
	ListNodePushBack(plist, 2);
	ListNodePushBack(plist, 3);
	ListNodePushBack(plist, 4);

	ListNodePintf(plist);
	ListNodePopBack(plist);
	ListNodePintf(plist);
	ListNodePopBack(plist);
	ListNodePopBack(plist);
	ListNodePintf(plist);


	ListNodeDestroyed(plist);
	plist = NULL;




}
test2()
{
	ListNode* plist = ListNodeInit();
	ListNodePushFront(plist, 1);
	ListNodePushFront(plist, 2);
	ListNodePushFront(plist, 3);
	ListNodePushFront(plist, 4);
	ListNodePushFront(plist, 5);
	ListNodePintf(plist);

	ListNodePophFront(plist);
	ListNodePophFront(plist);
	ListNodePophFront(plist);
	ListNodePophFront(plist);
	ListNodePintf(plist);	

	ListNodeDestroyed(plist);
	plist = NULL;



}
test3()
{
	ListNode* plist = ListNodeInit();
	ListNodePushBack(plist, 1);
	ListNodePushBack(plist, 2);
	ListNodePushBack(plist, 3);
	ListNodePushBack(plist, 4);
	ListNodePintf(plist);

	ListNode* pos = FindPos(plist, 4);
	ListNodeInsert(pos, 100);
	ListNodePintf(plist);
	pos = FindPos(plist, 4);
	ListNodePosErase(pos);
	ListNodePintf(plist);

	ListNodeDestroyed(plist);
	plist = NULL;

}
int main()
{
	test1();//尾插尾删测试
	test2();//头插头删测试
	test3();//pos位置测试

	return 0;
}

